export function debounce(fn, delay=100){
    let timer = null;
    return function(...args){
        if(timer) clearTimeout(timer)
        timer = setTimeout(() => {
            fn.apply(this,args);
        },delay)
    }
}

export function formatDate(number){
    //小时
    const date = new Date();

    let year = date.getFullYear(number);
    let month = date.getMonth(number) +1;
    let day = date.getDate(number);
    
    return year + "-" +month + "-" + day;
    
}